package base.template;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class RandomList<T> {
	List<T> list=new ArrayList<T>();
	Random random=new Random();
	public void add(T item){
		list.add(item);
	}
	public T select(){
		return list.get(random.nextInt(list.size()));
	}
	public static void main(String[] args) {
		RandomList<String> randomList=new RandomList<String>();
		for(String s:"the world is mine in time you best of others who ambious should leave".split(" ")){
			randomList.add(s);
		}
		
		for(int i=0;i<10;i++){
			String ss=randomList.select();
			System.out.println(ss);
		}
	}
}
